<?

error_reporting(E_ERROR | E_PARSE);

// Incluyo el archivo de configuracion
include_once(dirname(__FILE__).'/config.inc.php');

// Incluyo las librerias
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/core.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/router.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/router.config.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/model.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/controller_base.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/controller.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/controller_admin.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/view.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/template.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/ez_sql.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/session.class.php');
include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/auth.class.php');
//include_once(CONFIG_DOCUMENT_ROOT.'includes/lib/mailsmtp.class.php');

function __autoload($classname) {
	// Me fijo si es un Model o un Controller
	$type = strtolower(preg_replace('/(.*)(Controller|Model)$/', '\\2', $classname));
	// Le quito el "Model" del final del string
	$classname = preg_replace('/(Controller|Model)$/', '', $classname);
	// La convierto a su equivalente en archivo (camelcase to underscore)
	$classname = strtolower(preg_replace('/(.)([A-Z])/', '\\1_\\2', $classname));
	// Incluyo la clase
    include CONFIG_DOCUMENT_ROOT.'includes/'.$type.'/'.$classname.'.class.php';
}



function trimall($string) {
	return str_replace(' ','',$string);
}



?>
